<?php

namespace app\api\service;

class R
{
    private $code;
    private $message;
    private $data;

    static function success($message="SUCCESS",$data = array()){
        return json([
            "code"   => 200,
            "message"=> $message,
            "data"   => $data,
            "success"=> true
        ]);
    }

    static function error($message="ERROR",$code=404){
        return json([
            "code"   => $code,
            "message"=> $message,
            "success"=> false
        ]);
    }
}